/*
 * MyPaint.java
 *
 * Created on 13 mars 2008, 20:30
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package TP05;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import javax.swing.JComponent;

/**
 *
 * @author Morgan
 */
public class MyPaint extends JComponent{
    
    /** Creates a new instance of MyPaint */
    public MyPaint() {
    }
    
    public void paintComponent(Graphics g)
    {
    Graphics2D g2 = (Graphics2D) g;
    g2.setColor(Color.BLUE);
    Dimension compDim = getSize();
    Rectangle rectangle = new Rectangle((int)compDim.getWidth()/4,(int)compDim.getHeight()/4,(int)compDim.getWidth()/2,(int)compDim.getHeight()/2);
    g2.fill(rectangle);
    }
    
}
